//
//  tile.cpp
//  RPG
//
//  Created by Matt Bailey on 02/03/2014.
//  Copyright (c) 2014 Matt Bailey. All rights reserved.
//

#include "tile.hpp"

void Tile::create(string fileName) {
    
    string tileSource = loadFile("Resources/Tiles/" + fileName);
    
    stringstream ss;
    string line;
    
    ss.str("");
    ss << tileSource;
    
    while (getline(ss, line)) {
        
        stringstream ls(line);
        string variableName, value;
        
        ls >> variableName;
        
        if (variableName == "name") {
            ls >> name;
        }
        
        if (variableName == "speed") {
            ls >> speed;
        }
        
        if (variableName == "aqua") {
            ls >> aqua;
        }
    }
}